import Controller.*;
import lejos.nxt.*;
import java.io.*;

public class SonarFun {
	public static void main(String[] args) {
		UltrasonicSensor sonar = new UltrasonicSensor(SensorPort.S2);
		TouchSensor button = new TouchSensor(SensorPort.S3);
		int[] data = new int[8];
		while(true) {
			while(!button.isPressed());
			LCD.clearDisplay();
			sonar.ping();
			sonar.getDistances(data);
			for(int i=0;i<8;i++) LCD.drawString(Integer.toString(data[i]),0,i);
		}
	}
}